package designpatterns.responsibility.chain.code.approve;

/**
 * 院长审批
 */
public class Dean extends ApproveChain{

    @Override
    void doApprove(Approve approve) {
        if (approve.getAmount() > 5000
                && approve.getAmount() <= 10000) {
            process(approve);
        } else {
            super.getNextApprover().doApprove(approve);
        }
    }
    private void process(Approve approve) {
        System.out.println("(院长)"+super.getName()+"处理审批="+approve);
    }

    public Dean(String name) {
        super.name = name;
    }

}
